package com.dxx.cloud.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dxx.cloud.admin.module.entity.OrderDetailEntity;
import com.dxx.cloud.admin.module.entity.OrdersEntity;
import com.dxx.cloud.admin.module.request.OrderAddRequest;
import com.dxx.cloud.admin.module.request.OrderCompleteRequest;
import com.dxx.cloud.admin.module.request.OrderLatestRequest;
import com.dxx.cloud.admin.module.request.OrderPageListRequest;
import com.dxx.cloud.admin.module.response.OrdersResponse;
import com.dxx.cloud.admin.module.response.UnifiedOrderResponse;
import com.dxx.cloud.admin.module.response.wx.CreateOrderResponse;
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result;
import com.github.binarywang.wxpay.exception.WxPayException;
import org.dromara.common.mybatis.core.page.TableDataInfo;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 销售单表 服务类
 * </p>
 *
 * @author dh
 * @since 2025-06-06
 */
public interface IOrdersService extends IService<OrdersEntity> {
    TableDataInfo<OrdersResponse> orderPageList(OrderPageListRequest request) throws Exception;

    String getLatestOrderSerialNo(OrderLatestRequest serialNoCreateRequest);

    List<Long> addOrderDetail(OrderAddRequest request);

    List<OrderDetailEntity> orderDetailEntities(Long orderId);

    UnifiedOrderResponse payOrder(OrderCompleteRequest request) throws WxPayException;
    CreateOrderResponse startPayOrder(OrderCompleteRequest request) throws WxPayException;

    OrdersResponse detailResponseById(Serializable id);
    OrdersResponse detailResponseByOutTradeNo(String outTradeNo);
}
